//
//  ZDoctorHeadCell.m
//  DoctorFAQs
//
//  Created by zjq on 17/2/21.
//  Copyright © 2017年 zjq. All rights reserved.
//

#import "ZDoctorHeadCell.h"
@interface ZDoctorHeadCell () {
    UIView * _garyView;
}
@end
@implementation ZDoctorHeadCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self initlizeInterface];
    }
    return self;
}
- (void)initlizeInterface {
    [self makeAllSubView];
    [self addAllSubView];
    [self makeAllSubViewMasnoy];
}
- (void)makeAllSubView {
    self.leftImageView = [[UIImageView alloc] init];
    self.rightImageView = [[UIImageView alloc] init];
    self.rightImageView.image = [UIImage imageNamed:@"icon_right_r"];
    self.midTitleLabel = [[UILabel alloc] init];
    self.midTitleLabel.textAlignment = NSTextAlignmentLeft;
    self.midTitleLabel.font = [UIFont systemFontOfSize:15];
    self.midTitleLabel.text = @"";
    _garyView = [[UIView alloc] init];
    _garyView.backgroundColor = MYGRAYCOLOR;
}
- (void)addAllSubView {
    [self.contentView addSubview:self.leftImageView];
    [self.contentView addSubview:self.rightImageView];
    [self.contentView addSubview:self.midTitleLabel];
    [self.contentView addSubview:_garyView];
}
- (void)makeAllSubViewMasnoy {
    [self.leftImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView).offset(10*xsIZE);
        make.centerY .equalTo(self.contentView);
        make.width.offset(15*xsIZE);
        make.height.offset(15*ysIZE);
    }];
    [self.midTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.leftImageView.mas_right).offset(4*xsIZE);
        make.centerY.height.equalTo(self.leftImageView);
        make.width.offset(120*xsIZE);
    }];
    [self.rightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView).offset(-15*xsIZE);
        make.centerY.equalTo(self.leftImageView);
        make.height.offset(10*ysIZE);
        make.width.offset(5*xsIZE);
    }];
    [_garyView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.width.bottom.equalTo(self.contentView);
        make.height.offset(1.5*ysIZE);
    }];
}


@end
